# @Time: 2025/5/9 16:13
# @Author: chenhui
import json
# json转字符串，汉字会显示乱码，把编码属性设置为false即可
# data = {"user": "哈哈", "password": 1234}
# str_json = json.dumps(data, ensure_ascii=False)
# print(str_json)

# 字符串转json  显示类型是dict 可以默认为json形式
data = '{"user": "哈哈", "password": 1234}'
json_str = json.loads(data)
print(json_str)
print(type(json_str))